import request from '@/utils/request'

const api = {
  upload: '/upload/file',
  index: '/upload/list',
  move: '/upload_file/move',
  destroy: '/upload_file/destroy'
}

export function upload(params, data) {
  return request({
    headers: { 'Content-Type': 'multipart/form-data' },
    url: api.upload,
    method: 'post',
    params,
    data: data
  })
}

export function index(params) {
  return request({
    url: api.index,
    method: 'get',
    params
  })
}

export function move(data) {
  return request({
    url: api.move,
    method: 'put',
    data
  })
}

export function destroy(data) {
  return request({
    url: api.destroy,
    method: 'delete',
    data
  })
}
